package com.learn.practice.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;

@Data
public class ResultVO<T> {
    private Integer code;
    private String info;
    private T data;

    public static ResultVO success(Object obj){
        ResultVO result = new ResultVO();
        result.code=200;
        result.info="success";
        result.data = obj;
        return result;
    }

    public static ResultVO failure(Integer code, String info){
        ResultVO result = new ResultVO();
        result.code=code;
        result.info=info    ;
        result.data = null;
        return result;
    }
}
